<?php
    $this->stylesheet()->module();
?>

<h1>
    <a href="<?php echo $this->url(array(), 'blog') ?>">Blog</a>
    [<a href="<?php echo $this->url(array(), 'blogrss')?>">rss</a>] /
    <?php echo $this->category->title?> [<a href="<?php echo $this->url(array('alias' => $this->category->alias), 'blogcategoryrss')?>">rss</a>]
</h1>

<hr />
<div id="posts">
    <?php if ($this->paginator->count()): ?>
        <?php foreach($this->paginator as $row): $url = $this->url(array('alias'=> $row->alias), 'blogpost');?>
        <article>
            <header>
                <h3><a href="<?php echo $url?>"><?php echo $row->title?></a></h3>
                <div><?php echo $this->__('Posted on')?> <?php echo $this->date($row->published)?></div>
            </header>
          <div>
            <?php echo $row->teaser?>
          </div>
          <div>
              <?php echo $this->__('Posted by')?>
              <a href="<?php echo $this->url(array('login' => $row->login), 'blogauthor') ?>"><?php echo ucfirst($row->login)?></a>
              <?php echo $row->login?> <?php echo $this->__('in')?>
              <a href="<?php echo $this->url(array('alias' => $row->categoryAlias), 'blogcategory') ?>"><?php echo $row->categoryTitle?></a>
              |
              <a href="<?php echo $url?>"><?php echo $this->__('Comments')?> (<?php echo $row->comments ?>)</a>
          </div>
        </article>
        <?php endforeach;?>
    <?php else:?>
        <h4><?php echo $this->__('No posts')?></h4>
    <?php endif?>
</div>
<?php echo $this->paginationControl($this->paginator, 'Sliding', 'pagination.phtml'); ?>